package gold.digger;

import gold.utils.InputUtil;

import java.util.Arrays;

/**
 * Created by fanzhenyu02 on 2021/12/10.
 * common problem solver template.
 */
public class LC1033 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int[] numMovesStones(int a, int b, int c) {
            int z = Math.max(Math.max(a, b), c), x = Math.min(Math.min(a, b), c), y = a + b + c - z - x;
            int max = z - x - 2, min = (x + 1 == y && z - 1 == y) ? 0 : ((x + 1 == y || z - 1 == y || x + 2 == y || z - 2 == y) ? 1 : 2);
            return new int[]{min, max};
        }
    }

    public void run() {
        Solution solution = new Solution();
        System.out.println(Arrays.toString(solution.numMovesStones(1, 2, 5)));
        System.out.println(Arrays.toString(solution.numMovesStones(4, 3, 2)));
        System.out.println(Arrays.toString(solution.numMovesStones(3, 5, 1)));
    }

    public static void main(String[] args) throws Exception {
        LC1033 an = new LC1033();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
